<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <script type="text/javascript" language="javascript" src="../resources/js/util/jquery-1.7.2.js"
            charset="UTF-8"></script>
    <script type="text/javascript" language="javascript" src="../resources/js/util/json2.js"
            charset="UTF-8"></script>
    <script type="text/javascript" language="javascript" src="../resources/js/util/serializeObject.js"
            charset="UTF-8"></script>
    <script type="text/javascript" language="javascript" src="../resources/js/index.js" charset="UTF-8"></script>
    <link type="text/css" rel="stylesheet" href="../resources/css/index.css">
</head>
<body>
<div id="container">
    <jsp:include page="header.jsp"/>
    <div id="cart-container">
        <div id="cart">
            <c:import url="template/cartTemplate.jsp"/>
        </div>
    </div>
    <div class="center-container">
        <form id="book-form" >
            <table class="table-center">
                <tr>
                    <th><div></div></th>
                    <th><div>Название книги</div></th>
                    <th><div>Цена</div></th>
                </tr>
                <c:forEach var="book" items="${bookList}">
                    <tr>
                        <td>
                            <div>
                                <a href="#">
                                    <img src="../resources/img/${book.imagePath}"
                                         width="100px"
                                         height="120px"/>
                                </a>
                            </div>
                        </td>
                        <td><div id="book-name-${book.bookId}">${book.name}</div></td>
                        <td><div id="book-price-${book.bookId}">${book.price}</div></td>
                        <td>
                            <div>
                                <input id="add-to-cart-button-${book.bookId}"
                                       type="button"
                                       value="Добавить в корзину"
                                       onclick="addToCart(this);"/>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </form>
    </div>
</div>
</body>
</html>
